package com.neuedu.it.newidea.web.advice;
import com.neuedu.it.newidea.web.dto.RespEntity;
import org.springframework.web.bind.annotation.*;

@ControllerAdvice
public class ExceptionAdvice {
    @ExceptionHandler(Exception.class)
    @ResponseBody
    public RespEntity handleException(Exception e) {
        e.printStackTrace();
        return new RespEntity("5000", "服务器异常" + e.getMessage(), null);
    }

    @ExceptionHandler(RuntimeException.class)
    @ResponseBody
    public RespEntity handleException(RuntimeException e) {
        e.printStackTrace();
        return new RespEntity("5000", "服务器异常" + e.getMessage(), null);
    }
}